﻿<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="" />
    <meta name="author" content="" />

    <title>SB Admin 2 - Bootstrap Admin Theme</title>

    <!-- Bootstrap Core CSS -->
    <link href="/Asset/SBAdmin/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />

    <!-- MetisMenu CSS -->
    <link href="/Asset/SBAdmin/bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet" />

    <!-- Custom CSS -->
    <link href="/Asset/SBAdmin/dist/css/sb-admin-2.css" rel="stylesheet" />

    <!-- Custom Fonts -->
    <link href="/Asset/SBAdmin/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <div class="container">
        <div class="row">
            <div class="col-md-4 col-md-offset-4">
                <div class="login-panel panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">Please Sign In</h3>
                    </div>
                    <div class="panel-body">
                        <form role="form" id="form">
                            <fieldset>
                                <div class="form-group">
                                    <input class="form-control" placeholder="Account" name="Account" id="Account" type="text" />
                                </div>
                                <div class="form-group">
                                    <input class="form-control" placeholder="Password" name="Password" id="Password" type="password" />
                                </div>
                                <div class="form-group">
                                    <img id="imgvc" alt="Alternate Text" style="padding-bottom:2px;padding-right:3px;cursor:pointer" />
                                    <input class="form-control-sm" style="height:34px;width:220px" placeholder="Verify Code" name="VerifyCode" id="VerifyCode" type="text" />
                                </div>
                                <div class="checkbox">
                                    <label>
                                        <input name="IsRemberMe" id="IsRemberMe" type="checkbox" value="true" />Remember Me
                                    </label>
                                </div>
                                <!-- Change this to a button or input when using this as a form -->
                                <a href="###" id="sub" class="btn btn-lg btn-success btn-block">Login</a>
                            </fieldset>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- jQuery -->
    <script src="/Asset/SBAdmin/bower_components/jquery/dist/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="/Asset/SBAdmin/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="/Asset/SBAdmin/bower_components/metisMenu/dist/metisMenu.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="/Asset/SBAdmin/dist/js/sb-admin-2.js"></script>
    <script type="text/javascript">
        (function ($) {
            var sub = $("#sub");
            sub.click(function () {
                var account = $("#Account"),
                    password = $("#Password"),
                    verifycode = $("#VerifyCode");
                if (account.val().length == 0) {
                    alert("请填写账号");
                    return false;
                }
                if (password.val().length == 0) {
                    alert("请填写密码");
                    return false;
                }
                if (verifycode.length == 0) {
                    alert("请填写验证码");
                    return false;
                }
                var formdata = $("#form").serialize();
                $.post("/Login/Login", formdata, function (res) {
                    if (false == res.IsSuccess) {
                        alert(res.Msg);
                        return false;
                    }
                    window.location.href = "/AHome/Index";
                    return false;
                });
            });

            var imgvc = $("#imgvc");
            function ChangeIMGVC() {
                imgvc.attr("src", "/Login/VerifyCode?" + Math.random());
            }
            imgvc.click(ChangeIMGVC);
            ChangeIMGVC();

            $(document).keypress(function (event) {
                if (event.keyCode == 13) {
                    sub.click();
                }
            });

        })(jQuery);
    </script>
</body>
</html>